Skip to content

Arm backend: block invalid bilinear RESIZE downscale at 1/16#19151

Open
perheld wants to merge 1 commit intopytorch:mainfrom
perheld:change-1247991
Open

Arm backend: block invalid bilinear RESIZE downscale at 1/16#19151
perheld wants to merge 1 commit intopytorch:mainfrom
perheld:change-1247991

Conversation

@perheld
Copy link
Copy Markdown
Collaborator

@perheld perheld commented Apr 27, 2026

TOSA bilinear RESIZE requires the downscale ratio to be strictly greater than 1/16. The Arm backend currently accepts the exact 1/16 boundary case and can emit RESIZE parameters that the TOSA reference model rejects.

Move upsample operator gating into explicit Arm operator support checks. Keep nearest upsample explicitly supported there, and reject bilinear upsample cases whose computed TOSA RESIZE scale hits the invalid 1/16 boundary. Keep the corresponding validation in the fake TOSA RESIZE op so the dialect-level constraint is still enforced directly.

Also add regressions for the dialect-level validation and the end-to-end Arm bilinear interpolate case with align_corners=False and scale_factor=1/16.

Change-Id: I612fc7315fa4d1bd158e2f71bcaa493fcaf08c03

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell

Copilot AI review requested due to automatic review settings April 27, 2026 13:49
@perheld perheld requested a review from digantdesai as a code owner April 27, 2026 13:49
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 27, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19151

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 16 New Failures, 48 Pending

As of commit 867fd84 with merge base f61350b (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 27, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Apr 27, 2026
@perheld perheld added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend labels Apr 27, 2026
@perheld perheld added the release notes: none Do not include this in the release notes label Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens Arm backend handling of TOSA bilinear RESIZE by rejecting the invalid boundary downscale ratio of exactly 1/16, and shifts upsample delegation decisions into explicit operator-support checks so the partitioner can correctly gate bilinear upsample cases.

Changes:

  • Add dialect-level validation to reject bilinear RESIZE downscales with ratio <= 1/16 (including exactly 1/16).
  • Move upsample_{nearest,bilinear}2d support from static profile lists into explicit TOSA operator support checks, rejecting the boundary-invalid bilinear case.
  • Add regression tests for both the dialect RESIZE validation and the end-to-end Arm bilinear interpolate (align_corners=False, scale_factor=1/16) non-delegation behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
backends/arm/tosa/dialect/ops/resize.py Enforces the bilinear downscale > 1/16 constraint at the dialect fake-op validation level.
backends/arm/operator_support/upsample_support.py Adds explicit TOSA support checks for nearest/bilinear upsample; rejects bilinear cases that would generate invalid TOSA RESIZE scale.
backends/arm/operator_support/tosa_profile_supported_op_lists.py Removes upsample ops from unconditional support lists so conditional gating can be enforced via support checks.
backends/arm/operator_support/init.py Ensures the new upsample support checks are imported/registered.
backends/arm/test/misc/test_tosa_dialect_resize.py Adds regression for dialect-level bilinear RESIZE validation at the 1/16 boundary.
backends/arm/test/ops/test_upsample_bilinear2d.py Adds end-to-end regression ensuring exact 1/16 bilinear downscale does not delegate.
backends/arm/test/targets.bzl Registers the new dialect resize test in the Arm test target list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@zingo zingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge but if possible after #18948
Buck2 should be ok.

@zingo
Copy link
Copy Markdown
Collaborator

zingo commented Apr 27, 2026

OK to merge but if possible after #18948 Buck2 should be ok.

Thats merged now I do a rebase to make sure it works

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 27, 2026
@github-actions github-actions Bot added the module: arm Issues related to arm backend label Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 18:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

TOSA bilinear RESIZE requires the downscale ratio to be strictly greater
than 1/16. The Arm backend currently accepts the exact 1/16 boundary
case and can emit RESIZE parameters that the TOSA reference model
rejects.

Move upsample operator gating into explicit Arm operator support checks.
Keep nearest upsample explicitly supported there, and reject bilinear
upsample cases whose computed TOSA RESIZE scale hits the invalid 1/16
boundary. Keep the corresponding validation in the fake TOSA RESIZE op
so the dialect-level constraint is still enforced directly.

Also add regressions for the dialect-level validation and the
end-to-end Arm bilinear interpolate case with align_corners=False and
scale_factor=1/16.

Signed-off-by: Per Held <per.held@arm.com>
Change-Id: I612fc7315fa4d1bd158e2f71bcaa493fcaf08c03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arm bug: bilinear downscale by exactly 1/16 lowers to invalid TOSA RESIZE

3 participants